Fix #3089 - symlinked tempfiles should still report issues#3726
Conversation
Some linters will expand the paths of symlinked tempfiles when reporting them back to ALE. This ensures that if they do, the filename is still flagged appropriately as being temporary.
|
This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See |
|
why did this pull request not get merged? It does solve the problem on my setup (macOS as well). |
|
Thanks @joshpencheon for your pull-request! From the looks of it, this probably got closed merely due to unfortunate timing. I'm guessing it got filed when the maintainers were likely lacking the bandwidth to keep up with ale contributions. To my eyes the patch seemingly looks good, and it still rebases cleanly on current master (067e74f). Thus I'm reopening this and in the hope that either @hsanson or @w0rp will be able to take notice of it this time. |
Summary
This PR fixes #3089 (+ r-lib/lintr/issues/480), by ensuring that linters reporting issues against resolved symlink tempfile paths are still considered as reporting against tempfile paths.
Detail
For example, on macOS calls to
ale#util#Tempname()produce paths of the form/var/folders/..., which are actually symlinks to/private/var/...:$ pwd -P /var/folders/0r/65637b055vx11s2zwr4f_4k80000gn/T/nvimtH8m0W/15 /private/var/folders/0r/65637b055vx11s2zwr4f_4k80000gn/TIt is possible that a linter reports the physical location of ALE's tempfile of the buffer contents (output from
:ALEInfo):...which without this PR would not be detected as being a tempfile by
ale#path#IsTempName(filename)– preventing the issues being reported.